﻿using System;
using System.Data;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace HRMService
{
    
    [ServiceContract(Namespace = "http://HRMService")]
    public interface ICandidate
    {
        [OperationContract]
        int Candidate_Using(int CandidateID);

        [OperationContract]
        CandidateInfo Candidate_AutoCreateCode();

        [OperationContract]
        CandidateInfo Candidate_GetInfo(int CandidateID);

        [OperationContract]
        DataSet Candidate_GetList(out int ItemCount, int CR_CandidateID, string Status, string keyWord, int currentPage, int pageSize);
        /*
             - CR_CandidateID ở đây xét cho trạng thái tham gia phỏng vấn
                Nếu CR_CandidateID > 0 thì đã tham gia pv
                Nếu CR_CandidateID is null thì chưa tham gia pv
             - Status ở đây chỉ xét cho trạng thái trượt
                Nếu Status = "Truot" Thì lấy theo CR_Status = 3 or CR_Status = 5 or CR_Status = 7
                Nếu Status = "" Thì lấy tất không cần xét đến CR_Status
         */
        [OperationContract]
        int Candidate_Insert(CandidateInfo eInfo);

        [OperationContract]
        bool Candidate_Update(CandidateInfo eInfo);



        [OperationContract]
        bool Candidate_Delete(int CandidateID);

        [OperationContract]
        bool Candidate_Exist(int CandidateID, string CandidateNo);
    }
    [DataContract(Namespace = "http://HRMService")]
    public class CandidateInfo
    {
        #region VARIABLES

        int _ID;
        string _Code;
        string _FirstName;
        string _LastName;
        string _Alias;
        string _Education;
        DateTime _DateOfBirth;
        string _PlaceOfBirth;
        string _Address;
        string _Phone;
        bool _Sex;
        int _MaterialStatusID;
        int _ReligionID;
        int _EthlicID;
        string _IDCardNo;
        DateTime _IDCardIssueDate;
        string _IDCardIssueAuthority;
        DateTime _Date;
        string _Description;

        int _DepartmentID;
        int _PositionID;
        int _ResidentOfHaNoi;
        string _TransportMeans;
        DateTime _WhenAvailable;
        decimal _MinSalaryExpected;
        int _WorkOnShift;
        string _SpecialSkill;
        int _Acquaintance;
        string _AcquaintanceName;
        int _PartimeCourse;
        string _CourseName;
        int _CourseTime;
        string _FinancialController;
        DateTime _SalaryDate;
        DateTime _ProbationStartDate;
        int _ProbationPeriod;
        decimal _ProbationSalary;
        decimal _TraningSalary;
        decimal _ConfomationSalary;
        string _Others;

        int _CR_CandidateID;
        #endregion
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        [DataMember]
        public int PositionID
        {
            get { return _PositionID; }
            set { _PositionID = value; }
        }

        [DataMember]
        public int DepartmentID
        {
            get { return _DepartmentID; }
            set { _DepartmentID = value; }
        }
        
        [DataMember]
        public string No
        {
            get { return _Code; }
            set { _Code = value; }
        }
        
        [DataMember]
        public string FirstName
        {
            get { return _FirstName; }
            set { _FirstName = value; }
        }
        
        [DataMember]
        public string LastName
        {
            get { return _LastName; }
            set { _LastName = value; }
        }
        
        [DataMember]
        public string Alias
        {
            get { return _Alias; }
            set { _Alias = value; }
        }
        
        [DataMember]
        public string Education
        {
            get { return _Education; }
            set { _Education = value; }
        }
        [DataMember]
        public DateTime DateOfBirth
        {
            get { return _DateOfBirth; }
            set { _DateOfBirth = value; }
        }
        [DataMember]
        public string PlaceOfBirth
        {
            get { return _PlaceOfBirth; }
            set { _PlaceOfBirth = value; }
        }
        [DataMember]
        public string Address
        {
            get { return _Address; }
            set { _Address = value; }
        }
        [DataMember]
        public string Phone
        {
            get { return _Phone; }
            set { _Phone = value; }
        }
        [DataMember]
        public bool Sex
        {
            get { return _Sex; }
            set { _Sex = value; }
        }
        [DataMember]
        public int MaterialStatusID
        {
            get { return _MaterialStatusID; }
            set { _MaterialStatusID = value; }
        }
        [DataMember]
        public int ReligionID
        {
            get { return _ReligionID; }
            set { _ReligionID = value; }
        }
        [DataMember]
        public int EthlicID
        {
            get { return _EthlicID; }
            set { _EthlicID = value; }
        }
        [DataMember]
        public string IDCardNo
        {
            get { return _IDCardNo; }
            set { _IDCardNo = value; }
        }
        [DataMember]
        public DateTime IDCardIssueDate
        {
            get { return _IDCardIssueDate; }
            set { _IDCardIssueDate = value; }
        }

        [DataMember]
        public string IDCardIssueAuthority
        {
            get { return _IDCardIssueAuthority; }
            set { _IDCardIssueAuthority = value; }
        }
        [DataMember]
        public DateTime Date
        {
            get { return _Date; }
            set { _Date = value; }
        }
        [DataMember]
        public string Description
        {
            get { return _Description; }
            set { _Description = value; }
        }
        [DataMember]
        public string TransportMeans
        {
            get { return _TransportMeans; }
            set { _TransportMeans = value; }
        }
        [DataMember]
        public int ResidentOfHaNoi
        {
            get { return _ResidentOfHaNoi; }
            set { _ResidentOfHaNoi = value; }
        }
        [DataMember]
        public int WorkOnShift
        {
            get { return _WorkOnShift; }
            set { _WorkOnShift = value; }
        }
        [DataMember]
        public DateTime WhenAvailable
        {
            get { return _WhenAvailable; }
            set { _WhenAvailable = value; }
        }
        [DataMember]
        public decimal MinSalaryExpected
        {
            get { return _MinSalaryExpected; }
            set { _MinSalaryExpected = value; }
        }
        [DataMember]
        public string SpecialSkill
        {
            get { return _SpecialSkill; }
            set { _SpecialSkill = value; }
        }
        [DataMember]
        public int Acquaintance
        {
            get { return _Acquaintance; }
            set { _Acquaintance = value; }
        }
        [DataMember]
        public string AcquaintanceName
        {
            get { return _AcquaintanceName; }
            set { _AcquaintanceName = value; }
        }
        [DataMember]
        public int PartimeCourse
        {
            get { return _PartimeCourse; }
            set { _PartimeCourse = value; }
        }
        [DataMember]
        public string CourseName
        {
            get { return _CourseName; }
            set { _CourseName = value; }
        }
        [DataMember]
        public int CourseTime
        {
            get { return _CourseTime; }
            set { _CourseTime = value; }
        }
        [DataMember]
        public string FinancialController
        {
            get { return _FinancialController; }
            set { _FinancialController = value; }
        }
        [DataMember]
        public DateTime SalaryDate
        {
            get { return _SalaryDate; }
            set { _SalaryDate = value; }
        }
        [DataMember]
        public DateTime ProbationStartDate
        {
            get { return _ProbationStartDate; }
            set { _ProbationStartDate = value; }
        }
        [DataMember]
        public int ProbationPeriod
        {
            get { return _ProbationPeriod; }
            set { _ProbationPeriod = value; }
        }
        [DataMember]
        public decimal ProbationSalary
        {
            get { return _ProbationSalary; }
            set { _ProbationSalary = value; }
        }
        [DataMember]
        public decimal TraningSalary
        {
            get { return _TraningSalary; }
            set { _TraningSalary = value; }
        }
        [DataMember]
        public decimal ConfomationSalary
        {
            get { return _ConfomationSalary; }
            set { _ConfomationSalary = value; }
        }
        [DataMember]
        public string Others
        {
            get { return _Others; }
            set { _Others = value; }
        }

        [DataMember]
        public int CR_CandidateID
        {
            get { return _CR_CandidateID; }
            set { _CR_CandidateID = value; }
        }

    }

}
